/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.yournamehere.client;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.Side;
import com.smartgwt.client.types.TabBarControls;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.*;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.tab.Tab;
import com.smartgwt.client.widgets.tab.TabSet;

/**
 * Main entry point.
 *
 * @author User
 */
public class MainEntryPoint implements EntryPoint {
    /** 
     * Creates a new instance of MainEntryPoint
     */
    public MainEntryPoint() {
    }

    /** 
     * The entry point method, called automatically by loading a module
     * that declares an implementing class as an entry-point
     */
    public void onModuleLoad() {

        final TabSet tabSet = new TabSet();
        tabSet.setTabBarPosition(Side.TOP);

        //required so that the select item doesnt touch the tab pane
        tabSet.setTabBarThickness(25);
        tabSet.setTabBarAlign(Side.LEFT);
        tabSet.setWidth(400);
        tabSet.setHeight(200);
        tabSet.setAlign(Alignment.CENTER);
        final Tab statusTab = new Tab("Status");
        tabSet.addTab(statusTab);
        tabSet.setTabBarControls(TabBarControls.TAB_SCROLLER, TabBarControls.TAB_PICKER);

        TextItem codigoItem = new TextItem();
        codigoItem.setTitle("Codigo");
        codigoItem.setRequired(true);
        codigoItem.setMask("###-##-#####");

        PasswordItem passwordItem = new PasswordItem();
        passwordItem.setTitle("Password");
        passwordItem.setRequired(true);

        LinkItem paneLink=new LinkItem("");
        paneLink.setLinkTitle("¿Ha Olvidado su Contraseña?");
        
        DynamicForm profileForm = new DynamicForm();
        profileForm.setFields(codigoItem,passwordItem,paneLink);
        profileForm.setAlign(Alignment.CENTER);

        IButton saveButton = new IButton("Ingresar");
        
        VLayout ds=new VLayout();
        ds.addMember(profileForm);
        ds.addMember(saveButton);
        ds.setAlign(Alignment.LEFT);
        ds.setHeight("100%");
        ds.setWidth("100%");
        ds.setAlign(Alignment.CENTER);
        statusTab.setPane(ds);
        tabSet.setAlign(Alignment.CENTER);

        
        VLayout principal = new VLayout();
        principal.setWidth("63%");
        principal.setHeight("100%");
        principal.setAlign(Alignment.CENTER);
        principal.setAlign(VerticalAlignment.CENTER);
        principal.addMember(tabSet);
        //principal.draw();
        HLayout pr=new HLayout();
        pr.setWidth("100%");
        pr.setHeight("100%");
        Label cabez = new Label();
        cabez.setContents("");
        cabez.setWidth("37%");
        
        pr.addMember(cabez);
        pr.addMember(principal);
        pr.draw();

        //RootPanel.get().add(tabSet,450,150);
    }
}
